package com.tdam2013.grupo04;


import com.tdam2013.grupo04.Fragmento1.onFragmento1ClickListener;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.ImageButton;

public class Fragmento3 extends Fragment {
	//public static  String estado="activado";
	private ImageButton imageButton;
	MyInterface interface1;
	
   onFragmento3ClickListener listener;
	
	public interface onFragmento3ClickListener{
		public void onFragmento3ClickClick();
	}
	
	public void onAttach(Activity activity){
		super.onAttach(activity);
		try{
			listener= (onFragmento3ClickListener)activity;
		}catch(ClassCastException ex){
			Log.d("ClassCastException","La Activity debe implementar la interface 'onFragmento3ClickListener'");
		}
	}
	
	public void setInterface(MyInterface interface2) {
		this.interface1=interface2;
    }
	
	public View onCreateView(LayoutInflater inflater,ViewGroup container, Bundle savedInstanceState){
		View v =  inflater.inflate(R.layout.fragmento3,container,false);
		((ImageButton) v.findViewById(R.id.Imagebutton03)).setOnClickListener(new OnClickListener(){
			@Override
			public void onClick(View view){
				interface1.buttonClicked(view);
				 
			}
		});
		
		return v;
	}
	
	
	
	
	public void onResume(){
		super.onResume();

	}
	public void onPause(){
		super.onPause();
		//estado="desactivado";
	}
//	public String getEstado(){
//		return estado;
//	}
//	public void setEstado(String estado){
//	this.estado=estado;
//	}
//	
}
